<?php


namespace app\modules\Merchant\models;


class dispatchModel extends \Illuminate\Database\Eloquent\Model
{
    protected $table 		= 'dispatch';
    public	  $primaryKey	= 'id';

    protected function serializeDate($date)
    {
        return $date->format('Y-m-d H:i:s');
    }

    public function express()
    {
        return $this->hasMany(\dispatchexpressModel::class, 'dispatch_id', 'id');
    }

    public function store()
    {
        return $this->hasOne(\dispatchstoreModel::class, 'dispatch_id', 'id');
    }

    public function selfetch()
    {
        return $this->hasOne(\dispatchselfetchModel::class, 'dispatch_id', 'id');
    }

    public function autosend()
    {
        return $this->hasOne(\dispatchautosendModel::class, 'dispatch_id', 'id');
    }
}